home *** CD-ROM | disk | FTP | other *** search
/ El Mac 1 / Magazine.iso / EL MAC 1 / Shareware / Utilities / INITGestalt Inspector 1.0 / INITGestalt Inspector / INITGestalt Inspector.rsrc / TEXT_5000.txt < prev    next >
Encoding:
Text File  |  1995-08-08  |  11.1 KB  |  279 lines

  1. Alessandro Levi Montalcini
  2. C.so Re Umberto 10
  3. 10121 Torino
  4. Italy
  5. e-mail: LMontalcini@pmn.it
  6. ftp://ftp.alpcom.it/software/mac/LMontalcini
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13. INITGestalt Inspector 1.0 docs - August 1995
  14.  
  15. ‚Ä¢ Introduction
  16. ‚óä  INITGestalt Inspector is a free drag & drop utility that displays the INITGestalt table returned by INITGestalt-aware extensions, control panels and applications. End users can use the INITGestalt Inspector to extract some basic information about their INITGestalt-aware extensions, while programmers can use it to verify that their software is INITGestalt compliant. If you don‚Äôt know anything about the INITGestalt proposal, you may want to read the complete documentation below.
  17.  
  18. ‚Ä¢ INITGestalt
  19. ‚óä  Here‚Äôs a copy of the INITGestalt proposal by Jeremy Roussak and Rene G.A. Ros:
  20. ________________________________________________________________
  21.  
  22. INITGestalt: a proposal
  23. =======================
  24.  
  25. Version 1.0
  26. Last modified: March 21st, 1995 / 21 March 1995
  27.  
  28. It is often useful for an extension, or indeed an application, to know
  29. whether certain other extensions are running (the term "extensions"
  30. primarily includes system extensions, control panels and background-only
  31. applications, although there is no reason why it should not include
  32. ordinary applications). The reasons could be to take evasive action to
  33. avoid conflicts with other extensions, to co-operate with another
  34. extension, perhaps by using that extension's features, or possibly to
  35. disable similar features.
  36. Another useful application is to allow extension manager type of software
  37. to retrieve information they want to know in order to improve their
  38. features and usefullness to the users.
  39.  
  40. Fortunately, since system 6.0.4 a system-supported mechanism has existed
  41. whereby this could be achieved: Gestalt.
  42.  
  43. We would therefore like to propose a standard to which writers of software
  44. could adhere. The success of ShowINIT indicates that such a de facto
  45. standard can emerge.
  46.  
  47. 1.    Every extension should register a Gestalt selector equal to its
  48.     signature. If Gestalt subsequently returns gestaltUndefSelectorErr, the
  49.     extension is not loaded.
  50.  
  51. 2.    The value returned by Gestalt is of suffix type Table: that is, a
  52.     pointer to more data. The block to which the pointer points is already
  53.     allocated in the system heap and should not be disposed, since it might
  54.     be part of a larger memory block. The returned value may be nil if the
  55.     installed software is disabled and removed from memory, or when the
  56.     application has quit. The Gestalt definition function which returns the
  57.     value should not move memory and should be safe to be called at
  58.     interrupt time.
  59.  
  60. 3.    The minimum table returned should contain the record described below.
  61.     The table returned is read-only.
  62.  
  63.     C:
  64.     typedef struct
  65.     {
  66.         OSType            recType;        // always kGestaltRecordType
  67.         NumVersion        recVersion;        // version of the record format
  68.         NumVersion        igVersion;        // version of installed software
  69.         ulong            igStdAttr;        // standard defined attribute bits
  70.         ulong            reserved1;        // reserved, more attribute bits
  71.         ulong            igCustomAttr;    // custom defined attribute bits
  72.         ProcessSerialNumber    igProcess;    // PSN of installer
  73.         ISAType            igPlatformType;    // platform type
  74.         byte            reserved2;        // reserved
  75.         ushort            reserved3;        // reserved
  76.         ulong            igRefCon        // private pointer or handle
  77.     } INITGestaltRec, *INITGestaltRecPtr, **INITGestaltRecHandle;
  78.  
  79.     enum
  80.     {
  81.         kIGRecType                = 'JRRR',
  82.         kIGRecCurrentVersion    = $01008000,
  83.     
  84.         //    bit constants for the stdAttr field
  85.         kIGEnabled                = 0,
  86.         kIGDebugVersion,
  87.         kIGDebugEnabled,
  88.         kIGAcceptsAEvents,
  89.     }
  90.  
  91.  
  92.     PASCAL:
  93.     type
  94.     INITGestaltRec =    record
  95.         recType:        OSType;            {always kGestaltRecordType}
  96.         recVersion:        NumVersion;        {version of the record format}
  97.         igVersion:        NumVersion;        {version of installed software}
  98.         igStdAttr:        LongInt;        {standard defined attribute bits}
  99.         reserved1:        LongInt;        {reserved, more attribute bits}
  100.         igCustomAttr:    LongInt;        {custom defined attribute bits}
  101.         igProcess:        ProcessSerialNumber;    {PSN of installer}
  102.         igPlatformType:    ISAType;        {platform type}
  103.         reserved2:        Byte;            {reserved}
  104.         reserved3:        Integer;        {reserved}
  105.         igRefCon:        LongInt;        {private pointer or handle}
  106.         end;
  107.  
  108.     INITGestaltRecPtr = ^INITGestaltRec;
  109.     INITGestaltRecHandle = ^INITGestaltRecPtr;
  110.  
  111.     const
  112.         kIGRecType                = 'JRRR';
  113.         kIGRecCurrentVersion    = $01008000;
  114.  
  115.         {bit constants for the stdAttr field}
  116.         kIGEnabled                = 0;
  117.         kIGDebugVersion            = 1;
  118.         kIGDebugEnabled            = 2;
  119.         kIGAcceptsAEvents        = 3;
  120.  
  121.  
  122. recType
  123.     This field must always contain 'JRRR' (kIGRecType) to indicate it
  124.     supports the INITGestaltRec as defined by this standard.
  125.  
  126. recVersion
  127.     Contains a version number indicating the version of the INITGestalt
  128.     standard to which the INITGestaltRec complies. This field should be
  129.     filled using the kIGRecCurrentVersion constant. The version number is
  130.     in the same format as the first four bytes of a 'vers' resource.
  131.     This version number changes when fields are added and also when more
  132.     attribute bits are defined.
  133.  
  134. version
  135.     Holds the version of installed software in the same format as the first
  136.     four bytes of a 'vers' resource.
  137.  
  138. stdAttr
  139.     Holds attribute bits defined by this standard to indicate certain
  140.     capabilities. The following bits are currently defined, the others must
  141.     always be set to zero.
  142.  
  143.     kIGEnabled
  144.         If set, the installed software is currently enabled.
  145.  
  146.     kIGDebugVersion
  147.         If set, the installed software is a debugging version.
  148.  
  149.     kIGDebugEnabled
  150.         If set, the installed software is a debugging version and supports
  151.         a debug mode which can be turned on and off (this bit can never be
  152.         set if kIGDebugVersion is unset).
  153.  
  154.     kIGAcceptsAEvents
  155.         If set, the installed software can accept AppleEvents
  156.  
  157. reserved1
  158.     Reserved, possibly for more attribute bits defined by this standard.
  159.     Should be set to zero.
  160.  
  161. custAttr
  162.     Holds attribute bits defined by the software which installed this
  163.     selector pointing to the INITGestaltRec record. The developer can use
  164.     this field for attribute bits only and should define them with the
  165.     documentation as much as possible. Undefined bits must always be set to
  166.     zero.
  167.     
  168. process
  169.     Holds the Process Serial Number of the process which installed this
  170.     selector. If no process is associated this field must be zero
  171.     (kNoProcess). The other Process Manager constants kSystemProcess and
  172.     kCurrentProcess should not be used.
  173.  
  174. platform
  175.     This returns the ISAType indicating if the software is native PowerPC
  176.     code or 68K code. Use GetCurrentISA to get the current ISAType at
  177.     compile time. This is either kM68kISA (0) for the M680x0 system
  178.     architecture or kPowerPCISA (1) for the PowerPC system architecture.
  179.  
  180. reserved2
  181. reserved3
  182.     Reserved for future use. Should be set to zero.
  183.  
  184. refCon
  185.     Pointer or Handle to another block with custom and/or private data.
  186.     Should be nil if not used. In any event, the caller should not attempt
  187.     to dispose of the data block to which refCon points. One obvious use
  188.     of refCon would be to allow communication between a control panel and
  189.     its INIT component.
  190.  
  191. 4.    If your software installs a selector which adopts this standard, you
  192.     should email your documentation, which includes a description of the
  193.     custom fields, to Rene G.A. Ros for inclusion with the Gestalt
  194.     Selectors List (GSL). An entry in the GSL would look like this:
  195.  
  196.     =============================================================
  197.     SWVE (SimpleWave ext [1.0b1] by Rene G.A. Ros)
  198.          gestaltSimpleWaveTable
  199.          Returns a pointer to an INITGestalt structure.
  200.  
  201.          const
  202.          gestaltSimpleWaveTable = 'SWVE';
  203.     =============================================================
  204.  
  205.  
  206.  
  207. The code required to implement the basic functionality would be very small
  208. and very easy to write.
  209.  
  210. Comments on this proposal please: post rather than email.
  211.  
  212.  
  213.  
  214. Jeremy Roussak (jeremyr@dcs.qmw.ac.uk)
  215. Rene G.A. Ros (rgaros@bio.vu.nl)
  216.  
  217.  
  218. The following persons contributed ideas and corrections for which we want
  219. to thank them:
  220.     Dave Ely (ely@netcom.com)
  221.     Bill Hofmann (wdh@fresh.com)
  222.     ??? Grobbins (grobbins@apple.com)
  223.     John Mancino (mancino@decismkr.com)
  224.     Jens Miltner (jmiltner@theorie3.physik.uni-erlangen.de)
  225.     Alessandro Levi Montalcini (LMontalcini@pmn.it)
  226.     Fabrizio Oddone (gspnx@di.unito.it)
  227.     Quinn "The Eskimo" (quinn@cs.uwa.edu.au)
  228.     Caleb Strockbine (caleb@delbruck.sunysb.edu)
  229.     Chris Thomas (THUNDERONE@delphi.com)
  230.     Mark R. Valence (kurash@dartmouth.edu)
  231.     Hans Verbrugge (hverbrug@inter.nl.net)
  232.     Matthew Xavier Mora (mxmora@unix.sri.com)
  233.     and many others who discussed the merits of the Component Manager! :-)
  234.     
  235. ---------------------------------------------------------------------------
  236.  
  237. Changes
  238.     1.0 (21 march 1995)
  239.     -    renamed most fields to have them start with ig.
  240.  
  241.     1.0b2 (20 february 1995)
  242.     Because implementing the Control function with passing pointers to
  243.     different heap zones is considered a compatibility problem with future
  244.     System software, the Control function is deleted. A future proposal may
  245.     implement controlling functions using either the Component Manager or
  246.     the PPC Toolbox.
  247.     -    added kIGReserved bit for stdAttr field.
  248.     -    added platform field and unused fields for alignment.
  249.     -    removed kIGPPCNative bit for stdAttr field, replaced by platform
  250.         field.
  251.     -    removed text about adding additional private data to the record.
  252.     -    some minor changes and corrections to the text.
  253.  
  254.     1.0b1 (31 January 1995)
  255.     -    changed recVersion to NumVersion type.
  256.  
  257. ---------------------------------------------------------------------------
  258. History
  259. This proposal was initially written in 1992 for use by extensions by
  260. Jeremy Roussak based on an idea by Rene Ros. It never saw daylight because
  261. of other projects. After almost two year we saw some need for changes and
  262. to make it generally usuable for applications as well.
  263. ________________________________________________________________
  264.  
  265. ‚Ä¢ Version history
  266. ‚óä  1.0 - First public release, uses version 1.0 of the INITGestalt proposal by Jeremy Roussak and Rene G.A. Ros.
  267.  
  268. ‚Ä¢ Distribution
  269. ‚óä  INITGestalt Inspector is ¬©1994-95 Alessandro Levi Montalcini. It can be freely distributed as long as it is not modified and there‚Äôs no charge for it, but it may not be included in any commercial package without my consent.
  270. ‚óä  You may find the latest version of all my shareware programs by anonymous ftp to ftp.alpcom.it, inside the /software/mac/LMontalcini directory. The complete ShareDisk package, which contains all my stuff and can be registered at a very low price, is also available there.
  271. ‚óä  All online services and bulletin boards may make it available to their users at no charge other than the normal connection fees.
  272. ‚óä  All non-profit user groups may distribute it at no charge.
  273. ‚óä  All magazines may publish it on floppy disk without asking me first, as long as I get a copy of the issue containing my software.
  274. ‚óä  All CD-ROM shareware collections and CD-ROM magazines may include it without my prior consent, as long as I get either a copy of the CD-ROM or an offer to buy the CD-ROM at a discounted price.
  275. ‚óä  All redistribution companies such as Educorp may distribute it, as long as I get a copy of each media containing my software and a catalog of the company‚Äôs offerings (where applicable).
  276.  
  277. ‚Ä¢ Disclaimer
  278. ‚óä  INITGestalt Inspector shouldn‚Äôt cause any damage, but you‚Äôre using it at your own risk. As an independent software developer, I can make no warranties whatsoever on it.
  279.